const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    lintOnSave: false,
    assetsDir: 'static',
    publicPath: './',
    css: {
        modules: true,
        sourceMap: true
    },

    chainWebpack: config => {
        config.resolve.alias
            .set('@', resolve('src'))
            .set('images', resolve('src/images'))
            .set('styles', resolve('src/styles'))
    },

    devServer: {
        open: false,
        // host: "shanxihongdi.com",
        // port: 80,
        https: false,
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
        disableHostCheck: true,
        hotOnly: false,
        proxy: {
            '/hd-api': {
                target: "https://shanxihongdi.com/hd-api/",
                // ws: true,
                changOrigin: true,
                pathRewrite: {
                    '^/hd-api': '/'
                }
            }
        }
    }
}
